package com.eclink.asset.asset.controller;

import cn.hutool.core.bean.BeanUtil;
import com.eclink.asset.asset.domain.dao.AssetDepreciation;
import com.eclink.asset.asset.domain.dao.AssetFile;
import com.eclink.asset.asset.domain.vo.AssetFileVO;
import com.eclink.asset.asset.service.AssetDepreciationService;
import com.eclink.asset.asset.service.AssetFileService;
import com.eclink.asset.pojo.query.AssetItemQuery;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.utils.poi.ExcelUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 *
 * @author chenshixian
 */
@Api("资产折旧接口")
@RestController
@RequestMapping("/asset/depreciation")
public class AssetDepreciationController extends BaseController {

    @Resource
    private AssetDepreciationService service;

    @ApiOperation("查询")
    @GetMapping
    public ResponseEntity<AssetDepreciation> getInfo() {
        AssetDepreciation info = service.getInfo();
        return ResponseEntity.ok(info);
    }

    @ApiOperation("保存")
    @PutMapping
    public ResponseEntity<Integer> save(@RequestBody AssetDepreciation entity) {
        service.save(entity);
        return ResponseEntity.ok(1);
    }

}
